function DossierOffline() {
    var _this = this;
    var page;
    _this.page_size = 10;

    // init
    _this.init = function(_page) {
        page = _page;
        _this.initTable();
        _this.initEvent();
    }

    _this.initTable = function() {
        var list_url = appPath + "/admin/projectOffline/projectList";
        page.init("off_project_form", list_url, "project_table", "project_page", 1, _this.page_size);
        page.goPage(1);
        page.list = function(dataList){
            _this.obj = dataList;
            if(dataList == null){
                return;
            }
            var len = dataList.length;
            var inner = "", item;
            // 组装数据
            for(var i=0; i< len; i++) {
                item = dataList[i];
                // 组装数据
                inner += "<tr>";
                inner += "<td>"+(parseInt(i)+1)+"</td>";
                inner += "<td><span class=\"text-orange tooltip\" data-length='30'>"+item.projectName+"</span></td>";
                inner += "<td>"+(TimeUtil.longMsTimeConvertToDateTime(item['projectStartTime'])+"<br>"+TimeUtil.longMsTimeConvertToDateTime(item['projectEndTime']))+"</td>";
                inner += "<td>"+item.personCount+"</td>";
                inner += "<td>"+Enum.projectOfflineType(item.projectType)+"</td>";
                inner += "<td>"+item.createUser+"</td>";
                inner += "<td>"+TimeUtil.longMsTimeConvertToDateTime(item.createTime)+"</td>";
                inner += '<td>'+Enum.projectStatus(item.projectStatus)+'</td>'
                inner += '<td><a href="javascript:dossierOffline.projectInfo(\''+item.id+'\');" class="a a-info">培训详情</a> ';
                // inner += '<a href="javascript:dossierOffline.processManage(\''+item.id+'\');" class="a a-view">导出</a> ';
                inner += '<a href="' +　appPath + '/admin/dossier/projectOffline/export?project_id=' + item['id'] + '&project_type=' + item['projectType'] +'&projectName='+item['projectName']+ '" class="a a-view">导出</a>';
                inner += "</td>";
                inner += "</tr>";
            }
            return inner;
        }

    };

    _this.initEvent = function () {
        //搜索
        $("#project_search").click(function () {
            _this.initTable();
        });

        //全部
        $("#project_all").click(function () {
            $("#projectStartTime").val("");
            $("#projectEndTime").val("");
            $("#projectName").val("");
            _this.initTable();
        });
    }


    // 培训详情
    _this.projectInfo = function (projectId) {
        var url = appPath + "/admin/dossier/projectOffline/user?projectId="+projectId+"&isDossier="+"4";
        window.open(url,"_blank");
    }

    // 导出
    _this.processManage = function (projectId) {
        var url = appPath + "/admin/projectOffline/processManage?projectId="+projectId+"&isDossier="+"4";
        window.open(url,"_blank");
    }

    // 资料管理
    _this.datumManage = function (projectId) {
        layer.alert("该功能暂未实现...");

    }

    // 导出学员一览表
    _this.exportData = function (projectId, projectName, personCount) {
        if(0 == personCount){
            layer.alert("该项目无学员",{icon:7});
        }else{
            var date = new Date();
            var currentDate =date .getFullYear()+"-"+date.getMonth()+"-"+date.getDay();
            // 文件名
            var fileName = projectName+"_学员一览表"+ currentDate + ".xlsx";
            window.location.href = appPath + '/admin/projectOffline/allUserExport?projectId='+ projectId+"&fileName=" + fileName + "&projectName=" + projectName;
        }
    }

}

var dossierOffline = new DossierOffline();